package sky.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sky.dao.PlaneDAO;
import sky.domain.Plane;
import sky.service.PlaneService;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 21.04.13
 * Time: 23:28
 * To change this template use File | Settings | File Templates.
 */
@Service
public class PlaneServiceImpl implements PlaneService {

    @Autowired
    private PlaneDAO planeDAO;

    @Override
    @Transactional
    public void addPlane(Plane plane) {
        planeDAO.addPlane(plane);
    }

    @Override
    @Transactional
    public List<Plane> listPlane() {
        return planeDAO.listPlane();
    }

    @Override
    @Transactional
    public void removePlane(Integer id) {
        planeDAO.removePlane(id);
    }

    @Override
    @Transactional
    public Plane getPlaneById(Integer id) {
        return planeDAO.getPlaneById(id);
    }

    @Override
    @Transactional
    public void editPlane(Plane plane) {
        planeDAO.editPlane(plane);
    }
}
